From 2cbaa568b5628d8d279b66df70becfe6f6dbb3ef Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 27 Jul 2020 19:38:51 -0400 Subject: [PATCH] a11y: Add separator tests Tests the fix in the previous commit. --- testsuite/a11y/meson.build | 1 + testsuite/a11y/separator.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 testsuite/a11y/separator.c diff --git a/testsuite/a11y/meson.build b/testsuite/a11y/meson.build index d189ba8a43..7a18db587a 100644 --- a/testsuite/a11y/meson.build +++ b/testsuite/a11y/meson.build @@ -15,6 +15,7 @@ tests = [ { 'name': 'checkbutton' }, { 'name': 'dialog' }, { 'name': 'progressbar' }, + { 'name': 'separator' }, { 'name': 'window' }, ] diff --git a/testsuite/a11y/separator.c b/testsuite/a11y/separator.c new file mode 100644 index 0000000000..431090435d --- /dev/null +++ b/testsuite/a11y/separator.c @@ -0,0 +1,38 @@ +#include + +static void +separator_role (void) +{ + GtkWidget *widget = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); + g_object_ref_sink (widget); + + gtk_test_accessible_assert_role (widget, GTK_ACCESSIBLE_ROLE_SEPARATOR); + + g_object_unref (widget); +} + +static void +separator_properties (void) +{ + GtkWidget *widget = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); + g_object_ref_sink (widget); + + gtk_test_accessible_assert_property (widget, GTK_ACCESSIBLE_PROPERTY_ORIENTATION, GTK_ORIENTATION_HORIZONTAL); + + gtk_orientable_set_orientation (GTK_ORIENTABLE (widget), GTK_ORIENTATION_VERTICAL); + + gtk_test_accessible_assert_property (widget, GTK_ACCESSIBLE_PROPERTY_ORIENTATION, GTK_ORIENTATION_VERTICAL); + + g_object_unref (widget); +} + +int +main (int argc, char *argv[]) +{ + gtk_test_init (&argc, &argv, NULL); + + g_test_add_func ("/a11y/separator/role", separator_role); + g_test_add_func ("/a11y/separator/properties", separator_properties); + + return g_test_run (); +} -- 2.30.2